<?php  if (!defined('BASEPATH')) exit('No direct script access allowed');
// ------------------------------------------------------------------------

if ( ! function_exists('df_input')) {
    function df_input($format, $form_id, $field_name, $label, $dojo_props='', $format_function=FALSE) {          
        
        $row_head = '<tr><td>'. $label.'</td><td>';
        
        switch ($format) {
            case TYPE_TEXT:                                               
                    $out = '<input id="'.$field_name.'_'.$form_id.'" name="'.$field_name.'_'.$form_id.'"'; 
                    $out .= ' data-dojo-type="dijit.form.TextBox"';
                    $out .= ' data-dojo-props=\'type:"text"';
                    $out .= $dojo_props;
                    $out .= '\'/>';                    
                break;
            
            case TYPE_TEXTAREA:                                               
                    $out = '<div id="'.$field_name.'_'.$form_id.'" name="'.$field_name.'_'.$form_id.'"'; 
                    $out .= ' data-dojo-type="dijit.Editor"';
                    $out .= ' data-dojo-props=\'extraPlugins:["tabIndent"]';
                    $out .= $dojo_props;
                    $out .= '\'></div>';                    
                break;            

            default:
                break;
        }
        
        $row_foot = '</td></tr>';
        //echo $out;
        echo $row_head.$out.$row_foot;
    }    
}

if ( ! function_exists('dojo_model_out')) {
    function dojo_model_out($model, $fields, $form_id=0) {
        $CI =& get_instance();
        $CI->$model->dojo_out_html($fields, $form_id);
    }    
}

if ( ! function_exists('df_text_input')) {
    function df_text_input() {
        
    }    
}

if ( ! function_exists('df_number_input')) {
    function df_number_input() {
        
    }    
}

if ( ! function_exists('df_currency_input')) {
    function df_currency_input() {
        
    }    
}

if ( ! function_exists('df_text_input')) {
    function df_text_input() {
        
    }    
}
